// pages/good/good.js

import {request} from "../../utils/request"
Page({
  data: {
    goods:[],
    rid:'',
    goodsObj:{},
    cart:[]
  },
  onLoad(options) {
    let {rid} = options                                 
    console.log(rid);
    this.setData({rid})
    this.getGoods()
    },
    
  async getGoods (){
    console.log(this.data.rid);
    // data:{right_menu_data_id:rid}
    let {data} = await request ({url:"/getProductDetailsList?right_menu_data_id="+this.data.rid,method:'POST'})
    console.log("商品详情", data);
    this.setData({goods:data[0].data})
    console.log(data[0].data);

  },
  selectItem(e) {
    console.log('用户点击了：', e.target.dataset.index);
  }




})